﻿@model PluginModel

@{
	ViewBag.Title = T("Admin.Common.Configure").Text + " - " + Model.FriendlyName;
}

<script>
	$(function () {
		SmartStore.Admin.movePluginActionButtons();
	});
</script>

<div class="section-header">
	<div class="title" title="@ViewBag.Title (@Model.SystemName)">
		<img src="@Url.Content(Model.IconUrl)" alt="@Model.FriendlyName" />
		@ViewBag.Title
		<a href='@Url.Action("List")'>(@T("Admin.Common.BackToList"))</a>
	</div>
	<div class="options">	
		<a class="btn btn-secondary" href='@Url.Action("UpdateStringResources", new { systemName = Model.SystemName, returnUrl = Request.RawUrl })'>
			<i class="fa fa-sync"></i>
			<span>@T("Admin.Configuration.Plugins.Resources.Update")</span>
		</a>
	</div>
</div>

<div class="plugin-config-container">
	@if (Model.ConfigurationRoute != null && Model.ConfigurationRoute.Action.HasValue())
	{
		try
		{
			Html.RenderAction(Model.ConfigurationRoute.Action, Model.ConfigurationRoute.Controller, Model.ConfigurationRoute.RouteValues);
		}
		catch (Exception exception)
		{
			<div class="alert alert-danger">
				@T("Admin.Configuration.Plugins.UnknownError")
			</div>

			<pre>@exception.ToString()</pre>
		}
	}
	else
	{
		@T("Admin.Common.ConfigurationNotRequired")
	}
</div>


